<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "t_quiz_paper".
 *
 * @property string $id 主键
 * @property string $pid 父id
 * @property string $course_id 课程id
 * @property string $title 主标题
 * @property string $subhead 副标题
 * @property string $scope 考试范围
 * @property string $attentions 注意事项
 * @property int $total_time 做题时间
 * @property string $difficulty 难易程度
 * @property double $total_score 总分
 * @property string $paper_type 试卷类型（主观卷，客观卷）
 * @property string $type 类型（试卷/作业）
 * @property string $status 状态（新建/提交审核/审核不通过/审核通过）
 * @property string $auditor 审核人
 * @property string $check_time 审核时间
 * @property string $create_by 命题人
 * @property string $create_time 创建时间
 * @property string $update_by 更新人
 * @property string $update_time 更新时间
 * @property int $del_flag 删除标志
 * @property string $is_leaf 是否叶子节点
 * @property int $sequence 排序
 * @property string $item_id 章节id
 * @property string $item_top_id 单元id
 * @property string $note
 * @property double $pass_line
 * @property string $major_id
 */
class TQuizPaper extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 't_quiz_paper';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id'], 'required'],
            [['total_time', 'del_flag', 'sequence'], 'integer'],
            [['total_score', 'pass_line'], 'number'],
            [['check_time', 'create_time', 'update_time','title'], 'safe'],
            [['id', 'pid', 'course_id', 'auditor', 'create_by', 'update_by', 'item_id', 'item_top_id', 'major_id'], 'string', 'max' => 36],
//            [['title', 'subhead'], 'string', 'max' => 128],//3.0迁移需要屏蔽
            [['scope', 'attentions', 'note'], 'string', 'max' => 255],
            [['difficulty', 'paper_type', 'type', 'status', 'is_leaf'], 'string', 'max' => 64],
            [['id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'pid' => 'Pid',
            'course_id' => 'Course ID',
            'title' => 'Title',
            'subhead' => 'Subhead',
            'scope' => 'Scope',
            'attentions' => 'Attentions',
            'total_time' => 'Total Time',
            'difficulty' => 'Difficulty',
            'total_score' => 'Total Score',
            'paper_type' => 'Paper Type',
            'type' => 'Type',
            'status' => 'Status',
            'auditor' => 'Auditor',
            'check_time' => 'Check Time',
            'create_by' => 'Create By',
            'create_time' => 'Create Time',
            'update_by' => 'Update By',
            'update_time' => 'Update Time',
            'del_flag' => 'Del Flag',
            'is_leaf' => 'Is Leaf',
            'sequence' => 'Sequence',
            'item_id' => 'Item ID',
            'item_top_id' => 'Item Top ID',
            'note' => 'Note',
            'pass_line' => 'Pass Line',
            'major_id' => 'Major ID',
        ];
    }
}
